﻿<h2>Validation</h2>

<form name="testForm" novalidate data-radical-submit="onSubmit()">
    <div class="row">
        <div class="form-group" ng-class="{ 'has-error': (testForm.testName.$dirty || radical.testForm.submitAttempted) && testForm.testName.$invalid, 'has-success': (testForm.testName.$dirty || radical.testForm.submitAttempted) && testForm.testName.$valid }">
            <label class="control-label" for="name">Name</label>

            <input type="text" name="testName" data-ng-model="testName" class="form-control" placeholder="Enter test name..." required />

            <span class="control-label" data-ng-show="(testForm.testName.$dirty || radical.testForm.submitAttempted) && testForm.testName.$error.required">required</span>
        </div>
    </div>

    <div class="row">
        <button type="submit" class="btn btn-primary">Submit</button>
    </div>
</form>
